package com.xch.sboot.persistence.domain.common;

import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * @author xch
 * 2022/12/30 15:16
 */
@Data
@Entity
@Table(name = "base_file")
@EntityListeners(AuditingEntityListener.class)
public class File {
    @Id
    @Column(columnDefinition = "varchar(26) not null comment '主键 id' ")
    private String id;

    @Column(columnDefinition = "varchar(30) comment '现文件名称'")
    private String filename;

    @Column(columnDefinition = "varchar(30) comment '源文件名称'")
    private String oldname;

    @Column(columnDefinition = "varchar(20) comment '文件后缀' ")
    private String suffix;

    @Column(columnDefinition = "varchar(50) comment '文件上传类型' ")
    private String contentType;

    @Column(columnDefinition = "varchar(120) comment '文件全路径' ")
    private String fullpath;

    @Column(columnDefinition = "datetime comment '创建时间' ")
    @CreatedDate
    private LocalDateTime createTime;

    @Column(columnDefinition = "tinyint(1) comment '删除标志' ")
    private boolean delFlag;
}
